﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmartMathLibrary.Generator
{
    /// <summary>
    /// This class defines an abstract generator for integrated functions.
    /// </summary>
    [Serializable]
    public abstract class AbstractOneParameterIntegrationGenerator : AbstractOneParameterFunctionGenerator
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="AbstractOneParameterIntegrationGenerator"/> class.
        /// </summary>
        /// <param name="interval">The interval of the function generator.</param>
        protected AbstractOneParameterIntegrationGenerator(double interval)
            : base(interval)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="AbstractOneParameterIntegrationGenerator"/> class.
        /// </summary>
        /// <param name="interval">The interval of the function generator.</param>
        /// <param name="startvalue">The start value of the function generator.</param>
        protected AbstractOneParameterIntegrationGenerator(double interval, double startvalue)
            : base(interval, startvalue)
        {
        }

        /// <summary>
        /// Calculates the next value by using the specified function.
        /// </summary>
        /// <param name="limit">The limit of integration.</param>
        /// <returns>The result of the specified function at position x.</returns>
        public abstract double NextValue(int limit);
    }
}